import SvgIcon from '@/components/SvgIcon/index.vue'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import Category from '@/components/Category/index.vue'
import type { App } from 'vue'
//插件对象
const allglobalComponent: any = { SvgIcon, Category }

export default {
  install(app: App) {
    // 注册全部的全局组件
    Object.keys(allglobalComponent).forEach((key) => {
      app.component(key, allglobalComponent[key])
    })
    // 注册图标组件
    for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
      app.component(key, component)
    }
  },
}
